#include "Application.h"
#include "Test/TestWindow1.h"
namespace cxgui
{
using namespace test;

void Application::setup()
{
	_uiManager = make_shared<UIManager>();
	auto window = make_shared<TestWindow1>();
	window->SetBackColor(ColorA(0.f, 1.f, 0.f, 1.f));	
	_uiManager->AddWindow(window);	
}

void Application::mouseDown( MouseEvent event )
{
	_uiManager->MouseClick(event);
}

void Application::update()
{
	_uiManager->Update();
}

void Application::draw()
{
	// clear out the window with black
	gl::clear( Color( 0, 0, 0 ) ); 	
	gl::enableAlphaBlending();
	_uiManager->Draw();
}

void Application::keyUp( KeyEvent event )
{
	_uiManager->KeyDown(event);
}



}
CINDER_APP_NATIVE( cxgui::Application, cxgui::RendererGl )
